package vip.liux.backend.infrastructure.config;

import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jdbc.repository.config.EnableJdbcAuditing;
import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;

@Configuration(proxyBeanMethods = false)
@EntityScan(basePackages = {"vip.liux.backend.domain.models", "vip.liux.contracts.models", "vip.liux.contracts.infrastructure.converts", "vip.liux.orm.jpa.converts"})
public class SpringDataConfiguration {

    @Configuration(proxyBeanMethods = false)
    @EnableRedisRepositories(basePackages = "vip.liux.backend.infrastructure.redis")
    static class SpringDataRedisConfiguration {
    }

    @Configuration(proxyBeanMethods = false)
    @EnableJpaRepositories(basePackages = "vip.liux.backend.infrastructure.jpa")
    @EnableJpaAuditing
    static class SpringDataJpaConfiguration {
    }

    @Configuration(proxyBeanMethods = false)
    @EnableJdbcAuditing
    @EnableJdbcRepositories(basePackages = "vip.liux.backend.infrastructure.jdbc")
    static class SpringDataJdbcConfiguration {
    }
}
